local joyex__hongyan = fk.CreateSkill {

  name = "joyex__hongyan",

  tags = { Skill.Compulsory, },

}



joyex__hongyan:addEffect("filter", {
  name = "joyex__hongyan",
  frequency = Skill.Compulsory,
  card_filter = function(self,  to_select, player)
    return to_select.suit == Card.Spade and player:hasSkill(joyex__hongyan.name)
  end,
  view_as = function(self, player,to_select)
    return Fk:cloneCard(to_select.name, Card.Heart, to_select.number)
  end,
})

joyex__hongyan:addEffect("maxcards", {
  name = "#joyex__hongyan_maxcards",
  frequency = Skill.Compulsory,
  fixed_func = function(self, player)
    if player:hasSkill("joyex__hongyan") and table.find(player:getCardIds("e"), function(id)
      return Fk:getCardById(id).suit == Card.Heart or Fk:getCardById(id).suit == Card.Spade end) then  --FIXME: 耦！
      return player.maxHp
    end
  end
})

return joyex__hongyan